<?php

namespace app\admin\controller;


class Company extends BaseController {
    public function index() {
        $result = model('Company')->get(1);
        if (!$result) {
            return show(config('code.fail'), 'fail');
        }
        return show(config('code.success'), 'success', $result);
    }

    public function save() {
        $data = input('post.');
        $result = model('Company')->allowField(true)->save($data, ['id' => 1]);
        if (!$result) {
            return show(config('code.fail'), 'fail');
        }
        return show(config('code.success'), 'success');
    }
}